package com.wy.powerbuilder.mapper.ld;

import com.wy.powerbuilder.entity.ld.User;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Set;

public interface UserMapper {
    User getUser(String name);
    @Select("SELECT m.`m_name` FROM sys_menu m LEFT JOIN sys_role_menu rm ON m.`m_id`=rm.`mid` LEFT JOIN sys_role r ON r.`r_id`=rm.`rid` WHERE r.`r_name`=(SELECT sr.`r_name` FROM `user` u INNER JOIN sys_role sr ON u.`u_role`=sr.`r_id` WHERE u.`u_userName`=#{name})")
    Set<String> getMenu(String name);
    List<User> all(String u_userName);
    Integer upState(User user);
    Integer delUser(Integer id);
    Integer addAdmin(User user);
    User showUser(int id);
    Integer updateAdmin(User user);
}
